package edu.lit.B180401;

public class DBUtil {
    public static final String DB_NAME="StudentHobby.db";
    public static final String TABLE_STUINFO="stuinfo";
    public static final String TABLE_HOBBYTYPE="hobbytype";
    public static final String TABLE_HOBBYINFO="hobbyinfo";


    //stuinfo表中各字段
    public static final String STUINFO_ID="id";
    public static final String STUINFO_NAME="name";
    public static final String STUINFO_STUNO="stuno";

    //hobbytype表中各字段
    public static final String HOBBYTYPE_ID="id";
    public static final String HOBBYTYPE_NAME="name";

    //hobbyinfo表中各字段
    public static final String HOBBYINFO_ID="id";
    public static final String HOBBYINFO_STUID="stuid";
    public static final String HOBBYINFO_HOBBYTYPEID="hobbytypeid";

    //创建stuinfo表语句
    public static final String CREATE_TABLE_STUINFO="create table "+TABLE_STUINFO+
            "( "+STUINFO_ID+" INTEGER PRIMARY KEY AUTOINCREMENT ,"+
            STUINFO_NAME+" text not null  ,"
            +STUINFO_STUNO+" text not null"
            +"  );";
    //创建hobbytype表语句
    public static final String CREATE_TABLE_HOBBYTYPE="create table "+TABLE_HOBBYTYPE+
            "("+HOBBYTYPE_ID+" INTEGER PRIMARY KEY AUTOINCREMENT ,"+
            HOBBYTYPE_NAME+" text not null "
            +"  );";

    //创建hobbyinfo表语句
    public static final String CREATE_TABLE_HOBBYINFO="create table "+TABLE_HOBBYINFO+
            "("+HOBBYINFO_ID+" INTEGER PRIMARY KEY AUTOINCREMENT ,"+
            HOBBYINFO_STUID+" INTEGER not null,"
            +HOBBYINFO_HOBBYTYPEID+" INTEGER not null "
            +"  );";


}
